package org.gauth4me.core;

/**
 * Represents a MAC calculator.
 * <p/>
 * MAC stands for message authentication code.
 */
interface Mac {
  /**
   * Sets the secret key of this MAC calculator.
   *
   * @param key the secret key
   */
  void setKey(byte[] key);

  /**
   * Get the secret key of this MAC calculator.
   *
   * @return the secret key of this MAC calculator
   */
  byte[] getKey();

  /**
   * Calculates authentication code for given message.
   *
   * @param message the message to be signed
   * @return message's authentication code
   */
  byte[] sign(byte[] message);
}
